﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RapidDict.Modules.ContextTrayMenuServiceModule.cs" company="WordSteps.com">
//   All rights reserved
// </copyright>
// <summary>
//   Defines the ContextTrayMenuServiceModule type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace RapidDict.Modules.ContextTrayMenuService
{
    using Microsoft.Practices.Composite.Modularity;
    using Microsoft.Practices.Unity;
    using RapidDict.Infrastructure.Interfaces;

    [Module(ModuleName = "ContextTrayMenuServiceModule")]
    public class ContextTrayMenuServiceModule : IModule
    {
        IUnityContainer container;

        public ContextTrayMenuServiceModule(IUnityContainer container)
        {
            this.container = container;    
        }

        public void Initialize()
        {
            var appViewService = this.container.Resolve<IAppViewService>();
            var contextTrayMenuService = new Services.ContextTrayMenuService();

            this.container.RegisterInstance<IContextTrayMenuService>(contextTrayMenuService);
            this.container.RegisterInstance(new Services.NotifyIconService(appViewService, contextTrayMenuService));
        }
    }
}